package com.hyperf.core.logger;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.json.JsonWriteFeature;
import net.logstash.logback.decorate.JsonFactoryDecorator;

/**
 * @author lizhaoyang
 */
public class MyJsonFactoryDecorator implements JsonFactoryDecorator {

    @Override
    public JsonFactory decorate(JsonFactory factory) {
        // 禁用对非ascii码进行escape编码的特性
        factory.disable(JsonWriteFeature.ESCAPE_NON_ASCII.mappedFeature());
        return factory;
    }
}
